/*
 PureMVC Javascript Objs Employee Admin Demo for jQuery
 by Frederic Saunier <frederic.saunier@puremvc.org> 
 PureMVC - Copyright(c) 2006-12 Futurescale, Inc., Some rights reserved.
 Your reuse is governed by the Creative Commons Attribution 3.0 License
*/

/**
 * @class
 * Configure and initialize view for the application.
 *
 * @extends org.puremvc.js.patterns.command.SimpleCommand SimpleCommand
 *
 * @constructor
 */
var PrepViewCommand = Objs("freecars.controller.PrepViewCommand",
	SimpleCommand,
{	
	/**
	 * @override
	 */
	execute: function( note )
	{
	//alert(note.getBody().app);
		/*
		 */ 
				var homePage = new HomePage();
				var homePageMediator= new HomePageMediator( MediatorNames.HOME_PAGE_MEDIATOR, homePage );
				this.facade.registerMediator( homePageMediator );
			
                switch(current_page)
                {
                    case 'dashboard':
                              
                                var dashboardPage = new DashboardPage();
				var dashboardPageMediator= new DashboardPageMediator( MediatorNames.DASHBOARD_PAGE_MEDIATOR, dashboardPage );
				this.facade.registerMediator( dashboardPageMediator );
                           
                           break;
                    case 'vehicle_list':
				
                            var listPage=new ListPage();
                            var listPageMediator= new ListPageMediator( MediatorNames.VEHICLE_LIST_MEDIATOR, listPage );
                            this.facade.registerMediator( listPageMediator );
                            var mapPage=new MapPage();
                          
                          var mapPageMediator = new MapPageMediator( MediatorNames.VEHICLE_MAP_MEDIATOR, mapPage );
                          
                          this.facade.registerMediator( mapPageMediator );
                           break;
                    case 'view_page':
				     var detailPage=new DetailPage();	
                        var detailPageMediator= new DetailPageMediator( MediatorNames.DETAIL_PAGE_MEDIATOR, detailPage );
                           this.facade.registerMediator( detailPageMediator );
                          var mapPage=new MapPage();
                          
                          var mapPageMediator = new MapPageMediator( MediatorNames.VEHICLE_MAP_MEDIATOR, mapPage );
                          
                          this.facade.registerMediator( mapPageMediator );
                          break;
                        case 'info_page':
					
                          var detailPage=new DetailPage();
                          var detailPageMediator= new DetailPageMediator( MediatorNames.DETAIL_PAGE_MEDIATOR, detailPage );
                          this.facade.registerMediator( detailPageMediator );
                          var mapPage=new MapPage();
                          
                          var mapPageMediator = new MapPageMediator( MediatorNames.VEHICLE_MAP_MEDIATOR, mapPage );
                          
                          this.facade.registerMediator( mapPageMediator );
                          break;      
                    case 'superadmin':
				
							var adminPage=new AdminPage();
							var adminPageMediator= new AdminPageMediator( MediatorNames.ADMIN_PAGE_MEDIATOR, adminPage );
							this.facade.registerMediator( adminPageMediator );
							break;
								
					case 'locked_vehicles':
				
							var lockedVehiclesPage=new LockedVehiclesPage();
							var lockedVehiclesPageMediator= new LockedVehiclesPageMediator( MediatorNames.LOCKED_VEHICLES_PAGE_MEDIATOR, lockedVehiclesPage );
							this.facade.registerMediator( lockedVehiclesPageMediator );
							break;
							
					case 'reports':
							var reportsPage=new ReportsPage();
							var reportsPageMediator= new ReportsPageMediator( MediatorNames.REPORTS_PAGE_MEDIATOR, reportsPage );
							this.facade.registerMediator( reportsPageMediator );
							break;
							
                }
                
		
	}
});